/**
 * Project Name:hyc_hz_core
 * File Name:BusinessException.java
 * Package Name:com.wcy.common.exception
 * Date:Oct 21, 20168:31:56 PM
*/

package com.caiyouxi.common.exception;
import org.apache.log4j.Logger;



/**
 * User: Peng
 * Date: 2015/4/7 0007
 * Time: 上午 11:13
 */
public class BusinessException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	private static Logger logger = Logger.getLogger(BusinessException.class);
    private String errorCode;

	public BusinessException(String errorCode,String message){
        super(message);
        this.errorCode = errorCode;
	}

    public String getErrorCode() {
        return errorCode;
    }

    public BusinessException(ErrorCode model){
        super(model.getMsg());
        logger.info(model.getMsg());
        this.errorCode = model.getCode();
    }

    public BusinessException(String message){
		super(message);
	}

	public BusinessException(Throwable cause)
	{
		super(cause);
	}

	public BusinessException(String message,Throwable cause)
	{
		super(message,cause);
	}
}
